from spire.doc import *

from server import FileParser


class DocParser(FileParser):

    extensions = ['doc', 'docx']

    def parse_file_to_text(self, filename):
        document = Document()
        document.LoadFromFile(filename)
        return document.GetText()
